#ifndef MXBASE_YOLOV3CPPV2
#define MXBASE_YOLOV3CPPV2
#include "MxBase/MxBase.h"
#include "MxBase/postprocess/include/ObjectPostProcessors/Yolov3PostProcess.h"

struct V2Param {
    uint32_t deviceId;
    std::string labelPath;
    std::string configPath;
    std::string modelPath;
};

class YoloV3Cppv2
{
private:
APP_ERROR GetImage(const std::string &imgPath, std::shared_ptr<uint8_t>& dataPtr, uint32_t& dataSize);

protected:
uint32_t deviceId = 0;
std::shared_ptr<MxBase::ImageProcessor> imageProcessorDptr;
std::shared_ptr<MxBase::Model> yoloV3Dptr;
std::vector<MxBase::Tensor> yoloV3Outputs;

public:
YoloV3Cppv2(const V2Param &v2Param);
APP_ERROR ReadImage(const std::string &imgPath, MxBase::Image &decodedImage);
APP_ERROR Resize(const MxBase::Image& decodedImage, MxBase::Image &resizeImage);
APP_ERROR Infer(MxBase::Image &resizeImage, std::vector<MxBase::Tensor>& yoloV3Outputs);
APP_ERROR tensorInfer(std::vector<MxBase::Tensor>& yoloV3Iutputs, std::vector<MxBase::Tensor>& yoloV3Outputs);
void YoloV3PostProcess(std::string& yoloV3ConfigPath, std::string& yoloV3LablePath,
                        std::vector<MxBase::Tensor>& yoloV3Outputs, std::vector<MxBase::Rect>& cropConfigVec);
void generalPostProcess(std::vector<MxBase::Tensor>& inferOutputs); // Modify by user
};
#endif /* MXBASE_YOLOV3CPPV2 */
